home *** CD-ROM | disk | FTP | other *** search
- Path: qualcomm.com!usenet
- From: nababs@qualcomm.com (Nasser Abbasi)
- Newsgroups: comp.lang.c++
- Subject: Re: What is Object Oriented Programming (OOP)?
- Date: 11 Feb 1996 10:53:55 GMT
- Organization: Qualcomm Inc.
- Message-ID: <4fkhs3$b1g@qualcomm.com>
- References: <4f1nj6$4cie@news-s01.ny.us.ibm.net> <4fcv70$7tl@rockall.cc.strath.ac.uk>
- NNTP-Posting-Host: nabbasi.qualcomm.com
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.93.14
-
- In article <4fcv70$7tl@rockall.cc.strath.ac.uk>,
- scott.russell@strath.ac.uk says...
- >It is difficult to find a text book which
- >defines exactly what an object really is.
-
-
- Yes. But I really would not worry about finding an "official"
- definition for an object, a simple way to look at it is to think of an
- object as an entity that can take different values and have operations
- defined on it to modify the value of the entity.
-
- now, different terms can be used to describe some of the above words.
- the value of the object at any time, can be called the state of the
- object, ie.an object is supposed to have internal state, doing an
- operation on an object, can be called sending a message to the object.
-
- as a simple example, a variable of type integer is an "object".
-
- This object can take on values (1,2,-4,5, etc...), at any one time, i.e.
- the object has one of these values, i.e. its internal state at any one
- time has the value of 1 or 2 or -4 etc..
-
- It also have operations defined on it to change its state,
- we can define operations of add,subtract,divide,multiply,assignment,copy
- etc.. on objects of type integer. i.e we can "send" an add message to the
- object, we pass data with the message that the object internally uses.
-
- so, in OO terms,
-
- int a;
-
- a = 5;
-
- Means, create an object of type integer, then send message "assignment"
- to it, with data '5' as parameter of the message, this message causes the
- internal state of the object to change to new state, the value of the new
- state is '5'.
-
-
- Complicated objects can have complicate state, one that is a set of many
- sub states, and can support large operations on them. large object can be
- build up from smaller objects, some of the hardest parts of OOA, is
- determining what the objects are.
-
- Objects have public interface to them, this tell us what "messages" we
- can send to the object, and the form of the messages, that is really all
- what we need to know about the object (form the most part), the object
- internal state is hidden away from the outside view, to find out what is
- the state of the object we send a message to it to inquire about this.
-
- Nasser
- who_feels_like_rambling_too_much_tonight
-
-